1. Field of the Invention
The present invention relates to an image processing apparatus, an image processing method, and an image processing program product for reducing distortion when projecting images.
2. Description of the Related Art
To project an image onto a screen using an image projector apparatus, such as a screen projector, the image is often projected onto a screen 14 having a tilt angle β with respect to a normal projection direction 12 of a projector 10 as shown in FIG. 7.
As shown in FIG. 7, the image that is projected from the projector 10 is projected in a correct shape onto a vertical screen 16 that is perpendicular to the normal projection direction 12. However, as the projection angle Δα increases at the screen 14 having tilt angle β, the optical path length becomes longer, and as the optical path length becomes longer, an enlarged image is projected. Therefore, as shown in FIG. 8, an image 22 is projected with trapezoidal distortion with respect to an original image 20 projected onto the screen 16 that is perpendicular to the normal projection direction 12. Accordingly, trapezoidal correction processing is performed in advance on the image depending on the tilt angle β.
FIG. 9 shows a configuration of an image processing apparatus 100 of the related art for performing trapezoidal correction processing. The image processing apparatus 100 of the related art comprises an input section 32, a horizontal reduction section 34, a line memory controller 36, a line memory 38a, a line memory 38b, a vertical reduction section 40, a memory controller 42, a frame buffer 44, and an output section 46.
The input section 32 is an interface when receiving image data from the external image processing apparatus 100. As shown in FIG. 10, one screen of the input image data is composed of Nh pixels in the horizontal direction and Nv pixels in the vertical direction. For the purpose of convenience, the horizontal line that is projected along the normal projection direction 12 of the projector 10 is termed line number 0, and the line numbers increase in the manner of 1, 2, . . . , Nv as the projection angle Δα increases from 0° to the lens angle α.
At the horizontal reduction section 34, horizontal reduction processing is performed for reducing the number of pixels in the horizontal direction with respect to each horizontal line of the image data received by the input section 32. As shown in FIG. 7, when the projection angle Δα is 0°, namely, with respect to the horizontal line with line number 0, an optical path length L does not change to the screen 16 that is perpendicular to the normal projection direction 12 and to the screen 14 having tilt angle β with respect to the normal projection direction 12. On the other hand, when the projection angle Δα is the lens angle α, namely, with respect to the horizontal line with line number Nv, the optical path length r with respect to the screen 16 that is perpendicular to the normal projection direction 12 is L/cos α, and the optical path length R to the screen 14 having tilt angle β with respect to the normal projection direction 12 is expressed as L cos β/cos(α+β). Therefore, the number of corrected horizontal pixels Hn is calculated according to expression (1), and the horizontal line with line number Nv is reduced from Nh pixels to Hn corrected pixels in the horizontal direction.Hn=Nh×r/R=Nh×cos(α+β)/cos α/cos β  (1)
If the calculation results in a fraction below the decimal point, rounding is performed to yield an integer value. At this time, the number of pixels ΔHn to be reduced for each horizontal line with line number Ln can be obtained according to expression (2).ΔHn=Ln×(Nh−Hn)/Nv  (2)
The horizontal reduction section 34 receives, from an external source, setting data, such as lens angle α of the projector 10, tilt angle β, number of horizontal pixels Nh, line number Ln of the horizontal line being input, and so forth, performs processing to reduce the number of pixels in the horizontal line with line number Ln from Nh to Nh−ΔHn, and then outputs the result. In this case, as shown in FIG. 11A, as the projection angle Δα increases, the number of reduction pixels ΔHn increases. Therefore, as shown in FIG. 11B, an original rectangular image 50 is converted to a trapezoidal image 52 in which the number of pixels in the horizontal direction is reduced as the projection angle Δα increases. The image data processed by the horizontal reduction section 34 is transmitted one horizontal line at a time to the line memory controller 36.
The line memory controller 36 receives image data one pixel at a time. The received image pixel data is output to the vertical reduction section 40. Line memory 38a and 38b have at least the memory capacity to store and hold image data for the number of pixels in one horizontal line. Line memory 38a and 38b are controlled for first-in first-out (FIFO) by the line memory controller 36. When the line memory controller 36 receives image data for the next pixel, the image data for the last received pixel is stored and held into the FIFO controlled line memory 38a. The image data that overflows from the line memory 38a due to FIFO control is transferred to, then stored and held in FIFO-controlled line memory 38b. The line memory controller 36 reads out the image data for the previously received pixels only for one horizontal line and two horizontal lines with respect to the pixels received this time from the image data stored in line memory 38a and 38b, and this image data is output to the vertical reduction section 40. In this manner, the line memory controller 36 outputs to the vertical reduction section 40 the image data for the horizontal line currently being received and also outputs image data located at the same vertical position as the image data currently being received for the last horizontal line and the second to last horizontal line.
At the vertical reduction section 40 is performed vertical reduction processing for reducing the number of pixels of the image data in the vertical direction. As shown in FIG. 7, when the tilt angle is 0°, namely, with the screen 16 that is perpendicular to the normal projection direction 12, the image projected at lens angle α is projected with a length of X=L tan α in the vertical direction. On the other hand, with the screen 14 having tilt angle β with respect to the normal projection direction 12, the image projected at lens angle α is projected with a length of Y=L×(cos β×tan(α+β)−sin β) in the vertical direction. Therefore, the number of corrected vertical pixels Vn is calculated according to expression (3), and the number of pixels in the vertical direction of the image data is reduced from Nv pixels to Vn corrected pixels in the vertical direction.Vn=Nv×tan α/(cos β×tan(α+β)−sin β)  (3)
Furthermore, the number of pixels ΔVn to be reduced for the number of vertical pixels Nv2(Δα) existing from projection angle 0° to Δα can be obtained according to expression (4).ΔVn(Δα)=Nv2(Δα)×tan Δα/(cos β×tan(Δα+β)−sin β)  (4)
Therefore, the number of pixels ΔVn(Δα1, Δα2) to be reduced for the number of vertical pixels existing in a range of projection angles from Δα1 to Δα2 (where Δα1<Δα2) can be obtained according to expression (5).ΔVn(Δα1, Δα2)=(Nv2(Δα2)−ΔVn(Δα2))−(Nv2(Δα1)−ΔVn(Δα1))  (5)
The vertical reduction section 40 obtains the range of projection angles Δα at which is projected the image for data of three horizontal lines received from the line memory controller 36. Furthermore, the vertical reduction section 40 receives, from an external source, setting data, such as lens angle α of the projector 10, tilt angle β, number of horizontal pixels Nv, and so forth, obtains the number of reduction pixels according to the expression (5) for the range of projection angles Δα at which is projected the image for the received data of three horizontal lines, and reduces the number of pixels in the vertical direction. If the calculation results in a fraction below the decimal point, rounding is performed to yield an integer value. At this time, as shown in FIG. 11B, the number of pixels ΔVn to be reduced increases as the projection angle Δα increases. Therefore, as shown in FIG. 11C, the trapezoidal image 52 is converted to a barrel-shaped trapezoidal image 54. The image data processed at the vertical reduction section 40 is transmitted to the memory controller 42.
The memory controller 42 temporarily stores and holds the image data, which was processed at the vertical reduction section 40, into the frame buffer 44. The output section 46 reads out the image data held in the frame buffer 44 by accessing the memory controller 42 and outputs it in a displayable format to the projector 10, which is externally connected to the image processing apparatus 100.
As described hereinbefore, image data can be converted to the barrel-shaped trapezoidal image 54 by sequentially performing the horizontal reduction processing and the vertical reduction processing on the image data. When the barrel-shaped trapezoidal image 54 is projected onto the screen 14 at the tilt angle β, an image 56 that is unchanged with barrel distortion on the left and right is projected. As the tilt angle β increases and the amount of correction in the trapezoidal correction processing increases, the bulging on the left and right in the image 56 that is projected also increases.
This type of image distortion is a major problem when it is desirable to accurately display data, such as diagrams, graphs, and so forth, using a projector.